package com.oguzhan.xtools.view;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.UnsupportedLookAndFeelException;
import java.awt.Toolkit;

public class TokenGeneratorView {

	private JFrame frmXtoolsOuzhan;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					try {
					    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
					        if ("Nimbus".equals(info.getName())) {
					            UIManager.setLookAndFeel(info.getClassName());
					            break;
					        }
					    }
					} catch (UnsupportedLookAndFeelException e) {
					    // handle exception
					} catch (ClassNotFoundException e) {
					    // handle exception
					} catch (InstantiationException e) {
					    // handle exception
					} catch (IllegalAccessException e) {
					    // handle exception
					}
					
					TokenGeneratorView window = new TokenGeneratorView();
					window.frmXtoolsOuzhan.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public TokenGeneratorView() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frmXtoolsOuzhan = new JFrame();
		frmXtoolsOuzhan.setTitle("XTools - O\u011Fuzhan ACARG\u0130L 2012");
		frmXtoolsOuzhan.setIconImage(Toolkit.getDefaultToolkit().getImage(TokenGeneratorView.class.getResource("/tr/com/softtech/icons/viewUser.gif")));
		frmXtoolsOuzhan.setResizable(false);
		frmXtoolsOuzhan.setBounds(100, 100, 800, 700);
		frmXtoolsOuzhan.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frmXtoolsOuzhan.getContentPane().setLayout(new BorderLayout(0, 0));
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		frmXtoolsOuzhan.getContentPane().add(tabbedPane, BorderLayout.CENTER);
		
		JPanel testPanel = new JPanel();
		tabbedPane.addTab("Test ", new ImageIcon(TokenGeneratorView.class.getResource("/tr/com/softtech/icons/test.gif")), testPanel, null);
		testPanel.setLayout(new BorderLayout(0, 0));
		
		TestView panel = new TestView();
		testPanel.add(panel, BorderLayout.CENTER);
		
		JPanel logPanel = new JPanel();
		tabbedPane.addTab("Log Search ", new ImageIcon(TokenGeneratorView.class.getResource("/tr/com/softtech/icons/log-search.png")), logPanel, "ESB / WPS / WAS Log Searching");
		
		JPanel tokenPanel = new JPanel();
		tabbedPane.addTab("Token Generator ", new ImageIcon(TokenGeneratorView.class.getResource("/tr/com/softtech/icons/token-generator.gif")), tokenPanel, null);
		
		TokenView panel_1 = new TokenView();
		tokenPanel.add(panel_1);
		
		JPanel mockPanel = new JPanel();
		tabbedPane.addTab("Mocking ", new ImageIcon(TokenGeneratorView.class.getResource("/tr/com/softtech/icons/mocking.gif")), mockPanel, null);
		
		MockView panel_3 = new MockView();
		mockPanel.add(panel_3);
		
		JPanel schedulePanel = new JPanel();
		tabbedPane.addTab("Scheduloor ", new ImageIcon(TokenGeneratorView.class.getResource("/tr/com/softtech/icons/scheduloor.jpg")), schedulePanel, null);
		
		ScheduloorView panel_2 = new ScheduloorView();
		schedulePanel.add(panel_2);
		
		JMenuBar menuBar = new JMenuBar();
		frmXtoolsOuzhan.setJMenuBar(menuBar);
		
		JMenu mnFile = new JMenu("File");
		menuBar.add(mnFile);
		
		JMenuItem mntmOpen = new JMenuItem("Open");
		mnFile.add(mntmOpen);
		
		JMenuItem mntmSave = new JMenuItem("Save");
		mnFile.add(mntmSave);
		
		JMenuItem mntmSaveAs = new JMenuItem("Save As");
		mnFile.add(mntmSaveAs);
		
		JMenuItem mntmExit = new JMenuItem("Exit");
		mnFile.add(mntmExit);
		
		JMenu mnHelp = new JMenu("Help");
		menuBar.add(mnHelp);
		
		JMenuItem mntmAbout = new JMenuItem("About");
		mnHelp.add(mntmAbout);
	}
}
